Learn R Programming

vcd (version 0.9-9)

Pairs plot panel functions for diagonal cells: Diagonal Panel Functions for Table Pairs Plot

Description

Diagonal panel functions for pairs.table.

Usage

pairs_barplot(gp_bars = gpar(fill = "gray"),
  gp_vartext = gpar(fontsize = 17),
  gp_leveltext = gpar(),
  just_leveltext = c("center", "bottom"),
  just_vartext = c("center", "top"),
  rot = 0, abbreviate = FALSE, ...)
pairs_text(dimnames = TRUE, gp_vartext = gpar(fontsize = 17), 
  gp_leveltext = gpar(), gp_border = gpar(), ...) 
pairs_diagonal_text(varnames = TRUE, gp_vartext = gpar(fontsize = 17, fontface = "bold"),
  gp_leveltext = gpar(), gp_border = gpar(), pos = c("right","top"),
  distribute = c("equal","margin"), rot = 0, ...)

Arguments

dimnames
vector of logicals indicating whether the factor levels should be displayed (only used for pairs_text).
varnames
vector of logicals indicating whether the variable names should be displayed (only used for pairs_text_diagonal).
gp_bars
object of class "gpar" used for bars (only used for pairs_barplot).
gp_vartext
object of class "gpar" used for the factor names.
gp_leveltext
object of class "gpar" used for the factor levels.
gp_border
object of class "gpar" used for the border (only used for pairs_text).
just_leveltext, just_vartext
character string indicating the justification for variable names and levels.
pos
character string of length 2 controlling the horizontal and vertical position of the variable names (only used for pairs_text_diagonal).
rot
rotation angle for the variable levels.
distribute
character string indicating whether levels should be distributed equally or according to the margins (only used for pairs_text_diagonal).
abbreviate
integer or logical indicating the number of characters the labels should be abbreviated to. TRUE means 1 character, FALSE causes no abbreviation.
...
other parameters passed to the underlying graphics functions.

Value

  • A function with one argument: the marginal table for the corresponding dimension.

Details

In the diagonal cells, the pairsplot visualizes statistics or information for each dimension (that is: the single factors) alone. pairs_text displays the factor's name, and optionally also the factor levels. pairs_barplot produces a barplot of the corresponding factor, along with the factor's name.

See Also

pairs.table, pairs_assoc, pairs_mosaic

Examples

Run this code
data("UCBAdmissions")

pairs(UCBAdmissions) # pairs_barplot is default
pairs(UCBAdmissions, diag_panel = pairs_text)

pairs(UCBAdmissions, diag_panel = pairs_diagonal_text)
pairs(Titanic, diag_panel = pairs_diagonal_text)
pairs(Titanic, diag_panel = pairs_diagonal_text(distribute = "margin"))
pairs(Titanic,
      diag_panel = pairs_diagonal_text(distribute = "margin", rot = 45))

Run the code above in your browser using DataLab